home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / fire_it_.swf / scripts / __Packages / #37.as < prev    next >
Encoding:
Text File  |  2011-03-26  |  7.3 KB  |  219 lines

  1. class ┬º#37┬º
  2. {
  3.    static var ┬º#3┬º = false;
  4.    var score = 0;
  5.    var ┬º#121┬º = 0;
  6.    var ┬º#78┬º = 0;
  7.    var ┬º#80┬º = 0;
  8.    var ┬º#92┬º = 0;
  9.    var ┬º#88┬º = 0;
  10.    var ┬º#91┬º = 0;
  11.    var ┬º#87┬º = 0;
  12.    var ┬º#93┬º = 0;
  13.    var ┬º#89┬º = 0;
  14.    var ┬º#108┬º = 0;
  15.    var ┬º#401┬º = 0;
  16.    function ┬º#37┬º()
  17.    {
  18.       this["#29"] = new Array();
  19.       this["#224"] = new Array();
  20.       this.levelStats = new Array();
  21.       if(eval("#37")["#3"])
  22.       {
  23.          eval("#0").log(this["#2"]() + "created stats object");
  24.       }
  25.    }
  26.    function ┬º#2┬º()
  27.    {
  28.       return "Stats:  ";
  29.    }
  30.    function ┬º#271┬º(success, ┬º#44┬º)
  31.    {
  32.       var _loc6_ = eval("#25")["#163"]();
  33.       var _loc7_ = _root["#24"]["#248"]();
  34.       var _loc8_ = _root["#4"]["#9"].onFire;
  35.       this["#121"] = this["#121"] + 1;
  36.       if(!success)
  37.       {
  38.          if(eval("#37")["#3"])
  39.          {
  40.             var _loc9_ = "shots: " + this["#121"] + ", targets: " + this["#80"] + ", baskets: " + this["#78"] + "\n" + "missed shot\n" + "accuracy: " + _root["#11"]["#29"] + "/" + _root["#11"]["#23"];
  41.             _root["#143"].text = _loc9_;
  42.          }
  43.          return undefined;
  44.       }
  45.       this["#78"] = this["#78"] + 1;
  46.       if(_loc7_)
  47.       {
  48.          this["#91"] = this["#91"] + 1;
  49.       }
  50.       else
  51.       {
  52.          this["#92"] = this["#92"] + 1;
  53.       }
  54.       if(_loc6_)
  55.       {
  56.          this["#93"] = this["#93"] + 1;
  57.       }
  58.       this["#29"].push(_root["#11"]["#29"]);
  59.       this["#224"].push(_root["#11"]["#23"]);
  60.       var _loc4_ = ┬º#44┬º >= 15 ? Math.floor((┬º#44┬º - 10) / 5) : 0;
  61.       var _loc3_ = 0;
  62.       if(_loc8_ || _loc6_)
  63.       {
  64.          _root["#4"]["#59"] = true;
  65.          _root["#4"].bonusDisplay["#273"]();
  66.          _root["#4"]["#338"] = getTimer() + 1000;
  67.          if(_loc8_)
  68.          {
  69.             _loc3_ += 2;
  70.          }
  71.          if(_loc6_)
  72.          {
  73.             _loc3_ += 3;
  74.          }
  75.          _root["#4"]["bonusX" + _loc3_]["#273"]();
  76.       }
  77.       else
  78.       {
  79.          _loc3_ = 1;
  80.       }
  81.       var _loc5_ = !_loc7_ ? 3 : 2;
  82.       _loc5_ *= _loc3_;
  83.       this.score += _loc5_ + _loc4_;
  84.       this["#108"] += _loc4_;
  85.       _root["#4"]["#60"].score(_loc5_,true);
  86.       _root["#4"]["#60"].score(_loc4_,false);
  87.       _root["#237"].text = _loc5_ + _loc4_;
  88.       if(eval("#37")["#3"])
  89.       {
  90.          _loc9_ = "shots: " + this["#121"] + ", targets: " + this["#80"] + ", baskets: " + this["#78"] + "\n" + "points for this basket: " + _loc5_ + " x" + _loc3_ + "\n" + "consecutive baskets: " + ┬º#44┬º + ", streak bonus: " + _loc4_ + "\n" + "accuracy: " + _root["#11"]["#29"] + "/" + _root["#11"]["#23"];
  91.          _root["#143"].text = _loc9_;
  92.       }
  93.    }
  94.    function ┬º#337┬º()
  95.    {
  96.       var _loc3_ = eval("#25")["#163"]();
  97.       var _loc4_ = _root["#24"]["#248"]();
  98.       this["#80"] = this["#80"] + 1;
  99.       if(_loc4_)
  100.       {
  101.          this["#87"] = this["#87"] + 1;
  102.       }
  103.       else
  104.       {
  105.          this["#88"] = this["#88"] + 1;
  106.       }
  107.       if(_loc3_)
  108.       {
  109.          this["#89"] = this["#89"] + 1;
  110.       }
  111.    }
  112.    function ┬º#361┬º(level, time)
  113.    {
  114.       var _loc4_ = 0;
  115.       time = Math.round(time);
  116.       if(time > 0)
  117.       {
  118.          _loc4_ = level * 5;
  119.          this.score += _loc4_ + time;
  120.          _root["#4"]["#60"].score(_loc4_,false);
  121.          _root["#4"]["#60"].score(time,false);
  122.       }
  123.       if(eval("#37")["#3"])
  124.       {
  125.          eval("#0").log(this["#2"]() + "adding level stats: " + time + ", " + this["#108"] + ", " + _loc4_ + " (" + (_loc4_ + time) + " bonus points)");
  126.       }
  127.       this.levelStats[level] = [time,this["#108"],_loc4_];
  128.       this["#108"] = 0;
  129.    }
  130.    function ┬º#357┬º()
  131.    {
  132.       _root["#30"].text = this.score;
  133.       _root["#313"].text = this["#91"] + " / " + this["#87"] + " (" + this["#63"](this["#91"],this["#87"]) + "%)";
  134.       _root["#301"].text = this["#92"] + " / " + this["#88"] + " (" + this["#63"](this["#92"],this["#88"]) + "%)";
  135.       _root["#86"].text = this["#93"] + " / " + this["#89"] + " (" + this["#63"](this["#93"],this["#89"]) + "%)";
  136.       _root["#362"].text = this["#78"] + " / " + this["#80"] + " (" + this["#63"](this["#78"],this["#80"]) + "%)";
  137.       var _loc7_ = 0;
  138.       var _loc6_ = 0;
  139.       var _loc5_ = 0;
  140.       var _loc4_ = 1;
  141.       while(_loc4_ < this.levelStats.length)
  142.       {
  143.          _root["level" + _loc4_ + "_time"].text = Math.floor(this.levelStats[_loc4_][0]);
  144.          _loc7_ += Math.floor(this.levelStats[_loc4_][0]);
  145.          _root["level" + _loc4_ + "_streak"].text = this.levelStats[_loc4_][1];
  146.          _loc6_ += this.levelStats[_loc4_][1];
  147.          _root["level" + _loc4_ + "_complete"].text = this.levelStats[_loc4_][2];
  148.          _loc5_ += this.levelStats[_loc4_][2];
  149.          _loc4_ = _loc4_ + 1;
  150.       }
  151.       _root["#346"].text = _loc7_;
  152.       _root["#319"].text = _loc6_;
  153.       _root["#308"].text = _loc5_;
  154.       if(eval("#37")["#3"])
  155.       {
  156.          eval("#0").log(this["#2"]() + "\n" + this.toString());
  157.       }
  158.       if(eval("#5")["#249"])
  159.       {
  160.          _root["#67"].text = "";
  161.          _root["#67"]._visible = true;
  162.          Selection.setFocus(_root["#67"]);
  163.          var _loc8_ = new Object();
  164.          _loc8_.score = this.score;
  165.          _loc8_.onKeyDown = function()
  166.          {
  167.             if(Key.isDown(13))
  168.             {
  169.                if(eval("#37")["#3"])
  170.                {
  171.                   eval("#0").log("saving score " + this.score + " for player " + _root["#67"].text);
  172.                }
  173.                _global["#320"](_root["#67"].text,this.score ^ _global["#381"]);
  174.                _root["#67"].text = "";
  175.                _root["#67"]._visible = false;
  176.                _root["#295"].text = "Your score has been saved.";
  177.                Key.removeListener(this);
  178.             }
  179.          };
  180.          Key.addListener(_loc8_);
  181.       }
  182.    }
  183.    function toString()
  184.    {
  185.       var _loc4_ = "";
  186.       _loc4_ += "Score: " + this.score + "\n";
  187.       _loc4_ += "Shots: " + this["#121"] + "\n";
  188.       _loc4_ += "Baskets: " + this["#78"] + "\n";
  189.       _loc4_ += "Targets: " + this["#80"] + "\n";
  190.       _loc4_ += "Shooting %: " + this["#63"](_root["#4"]["#326"],_root["#4"]["#112"]) + "\n";
  191.       _loc4_ += "Average accuracy: " + this["#272"](this["#29"]) + "/" + this["#272"](this["#224"]) + "\n";
  192.       _loc4_ += "2 point shots: " + this["#91"] + "/" + this["#87"] + " (" + this["#63"](this["#91"],this["#87"]) + "%)" + "\n";
  193.       _loc4_ += "3 point shots: " + this["#92"] + "/" + this["#88"] + " (" + this["#63"](this["#92"],this["#88"]) + "%)" + "\n";
  194.       _loc4_ += "Pressure shots: " + this["#93"] + "/" + this["#89"] + " (" + this["#63"](this["#93"],this["#89"]) + "%)" + "\n";
  195.       var _loc3_ = 1;
  196.       while(_loc3_ < this.levelStats.length)
  197.       {
  198.          _loc4_ += "Level " + _loc3_ + ": time bonus = " + Math.floor(this.levelStats[_loc3_][0]) + ", streak bonus = " + this.levelStats[_loc3_][1] + ", completion bonus = " + this.levelStats[_loc3_][2] + "\n";
  199.          _loc3_ = _loc3_ + 1;
  200.       }
  201.       return _loc4_;
  202.    }
  203.    function ┬º#63┬º(┬º#467┬º, ┬º#463┬º)
  204.    {
  205.       return Math.floor(┬º#467┬º / ┬º#463┬º * 100);
  206.    }
  207.    function ┬º#272┬º(┬º#455┬º)
  208.    {
  209.       var _loc3_ = 0;
  210.       var _loc1_ = 0;
  211.       while(_loc1_ < ┬º#455┬º.length)
  212.       {
  213.          _loc3_ += ┬º#455┬º[_loc1_];
  214.          _loc1_ = _loc1_ + 1;
  215.       }
  216.       return Math.round(_loc3_ / ┬º#455┬º.length);
  217.    }
  218. }
  219.